﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using DiagrammInternalStructure.Exceptions;

namespace DiagrammInternalStructure
{
    public class ObjectsCounter
    {
        private static ulong m_objectMaxIndex = 0;
        private ulong m_index = 0;

        public ObjectsCounter()
        {
            if (m_objectMaxIndex < ulong.MaxValue)
            {
                m_index = ++m_objectMaxIndex;
            }
            else
            {
                throw new ObjectsQuantityLimitOverException();
            }
        }

        public ulong Index
        {
            get
            {
                return m_index;
            }
        }

        public static ulong CurrentMaxIndex
        {
            get
            {
                return m_objectMaxIndex;
            }
        }

        public static ulong MaxIndex
        {
            get
            {
                return ulong.MaxValue;
            }
        }
    }
}
